home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 60 / IOPROG_60.ISO / soft / c++ / gsl-1.1.1-setup.exe / {app} / src / cblas / test_amax.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-04-18  |  2.6 KB  |  143 lines

  1. #include <gsl/gsl_test.h>
  2. #include <gsl/gsl_ieee_utils.h>
  3. #include <gsl/gsl_math.h>
  4. #include <gsl/gsl_cblas.h>
  5.  
  6. #include "tests.h"
  7.  
  8. void
  9. test_amax (void) {
  10.   {
  11.    int N = 1;
  12.    float X[] = { -0.388f };
  13.    int incX = -1;
  14.    int expected = 0;
  15.    int k;
  16.    k = cblas_isamax(N, X, incX);
  17.    gsl_test_int(k, expected, "samax(case 52)");
  18.   };
  19.  
  20.  
  21.   {
  22.    int N = 1;
  23.    double X[] = { 0.247 };
  24.    int incX = -1;
  25.    int expected = 0;
  26.    int k;
  27.    k = cblas_idamax(N, X, incX);
  28.    gsl_test_int(k, expected, "damax(case 53)");
  29.   };
  30.  
  31.  
  32.   {
  33.    int N = 1;
  34.    float X[] = { 0.704f, 0.665f };
  35.    int incX = -1;
  36.    int expected = 0;
  37.    int k;
  38.    k = cblas_icamax(N, X, incX);
  39.    gsl_test_int(k, expected, "camax(case 54)");
  40.   };
  41.  
  42.  
  43.   {
  44.    int N = 1;
  45.    double X[] = { -0.599, -0.758 };
  46.    int incX = -1;
  47.    int expected = 0;
  48.    int k;
  49.    k = cblas_izamax(N, X, incX);
  50.    gsl_test_int(k, expected, "zamax(case 55)");
  51.   };
  52.  
  53.  
  54.   {
  55.    int N = 2;
  56.    float X[] = { 0.909f, 0.037f };
  57.    int incX = 1;
  58.    int expected = 0;
  59.    int k;
  60.    k = cblas_isamax(N, X, incX);
  61.    gsl_test_int(k, expected, "samax(case 56)");
  62.   };
  63.  
  64.  
  65.   {
  66.    int N = 2;
  67.    double X[] = { 0.271, -0.426 };
  68.    int incX = 1;
  69.    int expected = 1;
  70.    int k;
  71.    k = cblas_idamax(N, X, incX);
  72.    gsl_test_int(k, expected, "damax(case 57)");
  73.   };
  74.  
  75.  
  76.   {
  77.    int N = 2;
  78.    float X[] = { -0.648f, 0.317f, 0.62f, 0.392f };
  79.    int incX = 1;
  80.    int expected = 1;
  81.    int k;
  82.    k = cblas_icamax(N, X, incX);
  83.    gsl_test_int(k, expected, "camax(case 58)");
  84.   };
  85.  
  86.  
  87.   {
  88.    int N = 2;
  89.    double X[] = { -0.789, 0.352, 0.562, 0.697 };
  90.    int incX = 1;
  91.    int expected = 1;
  92.    int k;
  93.    k = cblas_izamax(N, X, incX);
  94.    gsl_test_int(k, expected, "zamax(case 59)");
  95.   };
  96.  
  97.  
  98.   {
  99.    int N = 2;
  100.    float X[] = { 0.487f, 0.918f };
  101.    int incX = -1;
  102.    int expected = 0;
  103.    int k;
  104.    k = cblas_isamax(N, X, incX);
  105.    gsl_test_int(k, expected, "samax(case 60)");
  106.   };
  107.  
  108.  
  109.   {
  110.    int N = 2;
  111.    double X[] = { 0.537, 0.826 };
  112.    int incX = -1;
  113.    int expected = 0;
  114.    int k;
  115.    k = cblas_idamax(N, X, incX);
  116.    gsl_test_int(k, expected, "damax(case 61)");
  117.   };
  118.  
  119.  
  120.   {
  121.    int N = 2;
  122.    float X[] = { 0.993f, 0.172f, -0.825f, 0.873f };
  123.    int incX = -1;
  124.    int expected = 0;
  125.    int k;
  126.    k = cblas_icamax(N, X, incX);
  127.    gsl_test_int(k, expected, "camax(case 62)");
  128.   };
  129.  
  130.  
  131.   {
  132.    int N = 2;
  133.    double X[] = { 0.913, -0.436, -0.134, 0.129 };
  134.    int incX = -1;
  135.    int expected = 0;
  136.    int k;
  137.    k = cblas_izamax(N, X, incX);
  138.    gsl_test_int(k, expected, "zamax(case 63)");
  139.   };
  140.  
  141.  
  142. }
  143.